package com.yunxi.controller.eai;

import com.yunxi.core.web.ApiResult;
import com.yunxi.ups.pojo.*;
import com.yunxi.ups.service.UpsDubboService;
import com.yunxi.ups.service.UpsPartenrDubboService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2019/9/1.
 */
@RestController
@RequestMapping("/esb/api")
@Api(tags = "esb:manage", description = "接收esb信息")
public class UpsController {
    @Autowired
    private UpsDubboService upsDubboServiceImpl;
    @Autowired
    UpsPartenrDubboService upsPartenrDubboServiceImpl;

    /*@PostMapping("/sendPartsPricePMS2UPS")
    @ApiOperation(value = "UPS维修系统发送渠道商配件库存价格信息给UPS工单系统")
    public ApiResult sendPartsPricePMS2UPS(@RequestBody PartsPriceVO order) throws Exception {
        ApiResult apiResult =upsDubboServiceImpl.sendPartsPricePMS2UPS(order);
        return apiResult;
    }*/
 /*   @PostMapping("/sendThreePacksOfWarnPMS2UPS")
    @ApiOperation(value = "UPS维修系统发送三包预警规则给UPS工单系统")
    public ApiResult sendThreePacksOfWarnPMS2UPS(@RequestBody ThreePacksOfWarnVO order) throws Exception {
        ApiResult apiResult =upsDubboServiceImpl.sendThreePacksOfWarnPMS2UPS(order);
        return apiResult;
    }*/

    @PostMapping("/sendActivityPMS2UPS")
    @ApiOperation(value = "UPS维修系统发送服务活动信息给UPS工单系统")
    public ApiResult sendActivityPMS2UPS(@RequestBody ActivityVO order) throws Exception {
        ApiResult apiResult =upsDubboServiceImpl.sendActivityPMS2UPS(order);
        return apiResult;
    }

    @PostMapping("/sendPreApprovePMS2UPS")
    @ApiOperation(value = "UPS维修系统发送预授权申请单给UPS工单系统")
    public ApiResult sendPreApprovePMS2UPS(@RequestBody PreApproveVO order) throws Exception {
        ApiResult apiResult =upsDubboServiceImpl.sendPreApprovePMS2UPS(order);
        return apiResult;
    }

 /*   @PostMapping("/sendClaimCheckoutPMS2UPS")
    @ApiOperation(value = "UPS维修系统发送索赔合理性校验规则给UPS工单系统")
    public ApiResult sendClaimCheckoutPMS2UPS(@RequestBody ClaimCheckoutVO order) throws Exception {
        ApiResult apiResult =upsDubboServiceImpl.sendClaimCheckoutPMS2UPS(order);
        return apiResult;
    }*/
 @PostMapping("/sendRepairOrderPMS2UPS")
 @ApiOperation(value = "UPS维修系统发送工单领料信息给UPS工单系统")
 public ApiResult sendRepairOrderPMS2UPS(@RequestBody RepairOrderVO order) throws Exception {
     ApiResult apiResult =upsDubboServiceImpl.sendRepairOrderPMS2UPS(order);
     return apiResult;
 }

    @PostMapping("/sendIamUserVO")
    @ApiOperation(value = "UPS系统发送人员信息数据给IAM系统")
    public ApiResult sendIamUserVO(@RequestBody List<UpsUserVO> upsUserList) throws Exception {
        ApiResult apiResult =upsPartenrDubboServiceImpl.sendIamUserVO(upsUserList);
        return apiResult;
    }

    @PostMapping("/sendUpsPostVO")
    @ApiOperation(value = "UPS系统发送渠道岗位信息")
    public ApiResult sendUpsPostVO(@RequestBody List<UpsPostVO> upsPostVO) throws Exception {
        ApiResult apiResult =upsPartenrDubboServiceImpl.sendUpsPostVO(upsPostVO);
        return apiResult;
    }
}
